﻿<UserControl x:Class="ProTemplate.UserControls.CustomControl.DeclarationPortCheckUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    mc:Ignorable="d" Unloaded="UserControl_Unloaded"
    d:DesignHeight="400" d:DesignWidth="1000">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="海关编号:" VerticalAlignment="Center" Margin="0,0,10,0" FontFamily="SimHei" />
            <TextBox x:Name="tbInputNumber" Width="140" Height="22" TextChanged="tbInputNumber_TextChanged" FontFamily="SimHei" />
            
            <StackPanel Orientation="Horizontal" Margin="10,0" >
                <Button x:Name="btnRefresh" Height="25" Width="40" Content="刷新" HorizontalAlignment="Left" Click="btnRefresh_Click" FontFamily="SimHei" />
                <Button x:Name="btnInport" Height="25" Width="50" Content="搜索进港" HorizontalAlignment="Left" Margin="5,0" Click="btnInport_Click" FontFamily="SimHei" />
                <Button x:Name="btn2Fang" Height="25" Width="50" Content="搜索二放" HorizontalAlignment="Left"  Click="btn2Fang_Click" FontFamily="SimHei" />
                <Button x:Name="btnLeavePort" Height="25" Width="50" Content="离港时间" HorizontalAlignment="Left" Margin="5,0" Click="btnLeavePort_Click" FontFamily="SimHei" />
                <Button x:Name="btnClearInput" Height="25" Width="50" Content="删除" HorizontalAlignment="Left" Click="btnClearInput_Click" FontFamily="SimHei" />
                <Button x:Name="btnSetDeclarationStatus" Height="25" Width="70" Content="设置报关状态" HorizontalAlignment="Left" Click="btnSetDeclarationStatus_Click" Margin="5,0" FontFamily="SimHei" />
                <CheckBox x:Name="cbSelectAll" Height="18" Width="70" Content="全选" HorizontalAlignment="Left" VerticalAlignment="Center" FontFamily="SimHei" Click="cbSelectAll_Click" ></CheckBox>
            </StackPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <TextBlock Text="网上箱号:" Margin="0,0,10,0" VerticalAlignment="Center"  FontFamily="SimHei" />
            <TextBox x:Name="tbNetContainerNumber" Width="500" Height="22" FontFamily="SimHei" FontSize="14"  />
        </StackPanel>
        <sdk:DataGrid x:Name="dgData" AutoGenerateColumns="False" Grid.Row="2" ItemsSource="{Binding Path=Items, Source={StaticResource DeclarationPortCheckViewModel}}" FontFamily="SimHei" LoadingRow="dgData_LoadingRow" SelectionChanged="dgData_SelectionChanged">
            <sdk:DataGrid.RowStyle>
                <Style TargetType="sdk:DataGridRow">
                    <Setter Property="Foreground" Value="{Binding Path=VerifyStatus, Converter={StaticResource VerifyStatusColorConverter}}" />
                    <Setter Property="FontFamily" Value="SimHei" />
                    <Setter Property="FontSize" Value="14" />
                </Style>
            </sdk:DataGrid.RowStyle>
            <sdk:DataGrid.Columns>
                <sdk:DataGridCheckBoxColumn Binding="{Binding CheckedItem}"/>
                <sdk:DataGridTextColumn Header="序号" Binding="{Binding Index}" />
                <sdk:DataGridTextColumn Header="客户" Binding="{Binding CustomerName}" />
                <sdk:DataGridTextColumn Header="海关编号" Binding="{Binding DeclarationNumber}" IsReadOnly="True" />
                <sdk:DataGridTextColumn Header="提运单号" Binding="{Binding BillNumber}" />
                <sdk:DataGridTextColumn Header="港区" Binding="{Binding Dock}" />
                <sdk:DataGridTextColumn Header="校验港区" Binding="{Binding VerifyDock}" />
                <sdk:DataGridTextColumn Header="二放信息" Binding="{Binding ErFangInfomation}" />
                <sdk:DataGridTextColumn Header="校验状态" Binding="{Binding VerifyStatus}" />
                <sdk:DataGridTextColumn Header="预配仓单" Binding="{Binding PrerecordWarehouseWarrant}" />
                <sdk:DataGridTextColumn Header="失败信息" Binding="{Binding FailedInformation}" />
                <sdk:DataGridTextColumn Header="箱号" Binding="{Binding BoxNumber}" />

                <sdk:DataGridTextColumn Header="网上箱号" Binding="{Binding NetBoxNumber}" IsReadOnly="True" />
                <sdk:DataGridTextColumn Header="件数" Binding="{Binding PackageNumber}" />
                <sdk:DataGridTextColumn Header="网上件数" Binding="{Binding NetPackageNumber}" />
                <sdk:DataGridTextColumn Header="毛重(公斤)" Binding="{Binding GrossWeight}" />
                <sdk:DataGridTextColumn Header="网上毛重(公斤)" Binding="{Binding NetGrossWeight}" />
                <sdk:DataGridTextColumn Header="箱量" Binding="{Binding BoxCount}" />
                <sdk:DataGridTextColumn Header="网上箱量" Binding="{Binding NetBoxCount}" />
                <sdk:DataGridTextColumn Header="运输工具" Binding="{Binding Conveyance}" />
                <sdk:DataGridTextColumn Header="网上运输工具" Binding="{Binding NetConveyance}" />
                <sdk:DataGridTextColumn Header="航次号" Binding="{Binding VoyageNumber}" />
                <sdk:DataGridTextColumn Header="网上航次号" Binding="{Binding NetVoyageNumber}" />
                <sdk:DataGridTextColumn Header="离港时间" Binding="{Binding LeaveTime}" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

        <Border Grid.RowSpan="3">
            <telerik:RadBusyIndicator x:Name="busyIndicator" DisplayAfter="0" IsBusy="False" BusyContent="正在处理，请稍候..." FontFamily="SimHei" />
        </Border>
    </Grid>
</UserControl>
